# Contributor: Holger Jaekel <holger.jaekel@gmx.de>
# Maintainer: Holger Jaekel <holger.jaekel@gmx.de>
pkgname=armadillo
pkgver=12.8.2
pkgrel=0
pkgdesc="C++ library for linear algebra & scientific computing"
url="https://arma.sourceforge.net/"
arch="all"
license="Apache-2.0"
options="!check"  # Armadillo must be installed before the tests can be compiled
depends_dev="
	hdf5-dev
	superlu-dev
	"
makedepends="
	$depends_dev
	arpack-dev
	cmake
	openblas-dev
	samurai
	"
subpackages="$pkgname-dev"
source="https://downloads.sourceforge.net/project/arma/armadillo-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	cd "$pkgdir"
	mkdir -p usr/lib/cmake
	mv usr/share/Armadillo/CMake/* usr/lib/cmake/
	rm -rf usr/share
}

sha512sums="
33bfe6f1fae2ef18ec3286742264dedd67730e47b5187568cb2fbe951286a5a8534a4b577894cc44415887241a46afb25b3fcf2b249ef15f9b71045e98fd0132  armadillo-12.8.2.tar.xz
"
